import java.util.Scanner;

public class demo12 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        float a = scanner.nextFloat(); // 快递重量
        char b = scanner.next().charAt(0); // 是否加急
       int price; // 快递费用
        if (a<= 1) {
            price = 20;
        } else {
            price = 20 + (int) Math.ceil(a - 1) * 1;
        }
        if (b == 'y') {
            price += 5;
        }
        System.out.println(price);
    }
}
